package com.lipaluma.parser.marshalling;

import com.lipaluma.io.Row;
import com.lipaluma.io.SourceWriter;

public class OneToManyMarshallerPathStrategy implements OneToManyMarshallerStrategy {

	@Override
	public void createOneToManyRows(SourceWriter fw, ObjectMarshalled objectMarshalled, Row row) {
//		PathRow pathRow = (PathRow)row;
//		for (Entry<Field, List<ObjectMarshalled>> oneToManyFieldValues : objectMarshalled.getOneToManyFieldsMarshalled().entrySet()) {
//			PathRow currentRow = pathRow;
//			Field field = oneToManyFieldValues.getKey();
//			PathOneToManyFieldMapper fieldMapper = (PathOneToManyFieldMapper)objectMarshalled.getRegisteredFieldMapper(field);
//			String path = fieldMapper.getMappingPath().getPath();
//			currentRow = currentRow.getExistingOrCreateOnlyParentRow(path);
//			for (ObjectMarshalled leafObjectMarshalled : oneToManyFieldValues.getValue()) {
//				PathRow leafRow = currentRow.createNewLeafRow(path);
//				for(FieldMarshalled fieldMarshalled : leafObjectMarshalled.getFieldsMarshalled()){
//					row.writeValue(fieldMarshalled.getValue(), fieldMarshalled.getMapping());
//				}
//				createOneToManyRows(fw, leafObjectMarshalled, leafRow);
//			}
//		}
	}

}
